﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using X23.ApplicationJob.Application.Dto;

namespace X23.ApplicationJob.Application
{
    public interface IJobService
    {
        /// <summary>
        /// 获取正在运行任务Key
        /// </summary>
        /// <returns></returns>
        List<string> GetRunningJobKey();
        /// <summary>
        /// 获取所有的job
        /// </summary>
        /// <returns></returns>
        List<AllJobDto> GetAllJob();
        /// <summary>
        /// 运行周期任务
        /// </summary>
        /// <param name="key">指定标识符</param>
        /// <returns></returns>
        bool RunJob(string key);

        /// <summary>
        /// 立即执行任务
        /// </summary>
        /// <param name="key">指定标识符</param>
        /// <returns></returns>
        bool TriggerJob(string key);

        /// <summary>
        /// 删除现有的周期任务
        /// </summary>
        /// <param name="key">指定标识符</param>
        /// <returns></returns>
        bool RemoveJob(string key);
    }
}
